package example.designpattern.memento.simple;

//负责人
public class Caretaker {

  private Memento memento;

  public Memento recoverMemento() throws Exception {

		if (memento == null) {
			throw new Exception("没有保存的状态");
		}
    return this.memento;//恢复状态
  }

  public void saveMemento(Memento memento) {

    this.memento = memento;//保存状态
  }

}
